Skip to content

feat(cli): add option for a single output-dir and hide options#1099

Open
jlarkin09 wants to merge 1 commit intopython-wheel-build:mainfrom
jlarkin09:feat/add-output-dir-cli-option
Open

feat(cli): add option for a single output-dir and hide options#1099
jlarkin09 wants to merge 1 commit intopython-wheel-build:mainfrom
jlarkin09:feat/add-output-dir-cli-option

Conversation

@jlarkin09
Copy link
Copy Markdown
Contributor

Add a new -O/--output-dir option that sets the base directory for sdists-repo, wheels-repo, and work-dir. The individual directory options are hidden but still functional for backwards compatibility. When --output-dir is "." (the default), behavior is identical to before.

Simplifies the CLI by consolidating three separate directory options into one. Addresses review feedback from #905.

Closes: #721

@jlarkin09 jlarkin09 requested a review from a team as a code owner April 30, 2026 14:15
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a33ab961-cb33-4f54-b843-7137d5f50622

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change consolidates output directory handling in the CLI by introducing a new --output-dir/-O option. The --sdists-repo, --wheels-repo, and --work-dir flags are converted to optional override-style options that default to None. The main function applies precedence logic: when these per-directory values are not provided, they are derived from the output directory by appending subdirectory names. The derived paths are then passed to context.WorkContext.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately describes the main change: adding a new --output-dir CLI option and hiding existing directory options.
Description check ✅ Passed Description clearly relates to the changeset, explaining the new -O/--output-dir option, backwards compatibility, and issue references.
Linked Issues check ✅ Passed PR fully implements the requirement from #721 to simplify output directory handling with a single --output-dir flag while maintaining backwards compatibility.
Out of Scope Changes check ✅ Passed All changes are directly related to the --output-dir feature and CLI parameter updates specified in issue #721; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/fromager/__main__.py (1)

164-185: ⚡ Quick win

Add a docstring to main() after expanding its public CLI contract.

main() gained new behavior and parameters (output_dir + override precedence), so a short docstring here would improve maintainability and CLI intent clarity.

As per coding guidelines, "Add docstrings on all public functions and classes".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/fromager/__main__.py` around lines 164 - 185, Add a concise docstring to
the public function main() explaining its purpose as the CLI entrypoint,
summarizing the new behavior and parameter roles (notably output_dir and its
override precedence relative to settings_file/settings_dir), documenting key
parameters like output_dir, sdists_repo, wheels_repo, work_dir, patches_dir,
settings_file/settings_dir, constraints_file, cleanup, variant, jobs,
network_isolation, and min_release_age, and stating it returns None; place the
docstring directly after the def main(...) signature so future maintainers
understand the CLI contract and override rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/fromager/__main__.py`:
- Around line 164-185: Add a concise docstring to the public function main()
explaining its purpose as the CLI entrypoint, summarizing the new behavior and
parameter roles (notably output_dir and its override precedence relative to
settings_file/settings_dir), documenting key parameters like output_dir,
sdists_repo, wheels_repo, work_dir, patches_dir, settings_file/settings_dir,
constraints_file, cleanup, variant, jobs, network_isolation, and
min_release_age, and stating it returns None; place the docstring directly after
the def main(...) signature so future maintainers understand the CLI contract
and override rules.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bbdcde0a-dfa2-4165-9c30-073413d53171

📥 Commits

Reviewing files that changed from the base of the PR and between a19dea7 and 215987c.

📒 Files selected for processing (1)
  • src/fromager/__main__.py

Add a new -O/--output-dir option that sets the base directory for
sdists-repo, wheels-repo, and work-dir. The individual directory
options are hidden but still functional for backwards compatibility.
When --output-dir is "." (the default), behavior is identical to
before.

Closes: python-wheel-build#721
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Justin Larkin <jlarkin@redhat.com>
Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify output directory handling

1 participant